Skip to content

Skip URLs starting with tilde - #119

Merged
sergcen merged 3 commits into
postcss:masterfrom
kisenka:skip-urls-with-tilde
Apr 3, 2018
Merged

Skip URLs starting with tilde#119
sergcen merged 3 commits into
postcss:masterfrom
kisenka:skip-urls-with-tilde

Conversation

@kisenka

@kisenka kisenka commented Feb 28, 2018

Copy link
Copy Markdown
Contributor

Hi!
Webpack has cool feature to determine import from node_modules in stylesheets. Such imports are starting with tilde ~ and should not be processed by this plugin. This PR introduce ability to skip such imports. Corresponding tests are added.

Comment thread src/lib/decl-processor.js Outdated
*/
const URL_PATTERNS = [
/(url\(\s*['"]?)([^"')]+)(["']?\s*\))/g,
/(url\(\s*['"]?)(?!~)([^"')]+)(["']?\s*\))/g,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's do it differently
add condition for ~ to here
https://github.com/postcss/postcss-url/blob/master/src/lib/paths.js#L37

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sergcen done!

@kisenka

kisenka commented Apr 3, 2018

Copy link
Copy Markdown
Contributor Author

@sergcen ping

@sergcen
sergcen merged commit de6f6e2 into postcss:master Apr 3, 2018
@sergcen

sergcen commented Apr 3, 2018

Copy link
Copy Markdown
Contributor

@kisenka published

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants